package ThriftExam;

import org.apache.thrift.server.TServer;
import org.apache.thrift.server.TSimpleServer;
import org.apache.thrift.transport.TServerSocket;
import org.apache.thrift.transport.TServerTransport;
import org.apache.thrift.transport.TTransportException;

/**
 * Created with IntelliJ IDEA.
 * User: belict
 * Date: 12/2/13
 * Time: 12:47 PM
 * To change this template use File | Settings | File Templates.
 */
public class RunServer {
    public static void main(String[] args) throws TTransportException {
        ThriftPrinterHandler trThriftPrinterHandler = new ThriftPrinterHandler();
        ThriftPrinter.Processor processor = new ThriftPrinter.Processor(trThriftPrinterHandler);

        TServerTransport tServerTransport = new TServerSocket(9090);
        TServer tServer = new TSimpleServer(new TServer.Args(tServerTransport).processor(processor));

        System.out.println("Server startede ");
        tServer.serve();

    }
}
